package com.tarena.spring.boot;

import org.junit.Test;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.core.io.support.SpringFactoriesLoader;

import java.util.List;

public class RunSpringFacotires {
    @Test
    public void loadSpringFactories(){
        /**
         * loadFactoryNames有2个参数
         * factorType 是一个文件的key值 Class类型反射对象
         * classLoader 当前代码类加载器
         */
        List<String> stringList = SpringFactoriesLoader.loadFactoryNames(
                EnableAutoConfiguration.class,
                RunSpringFacotires.class.getClassLoader());
        System.out.println(stringList.size());
    }
}
